import com.bean.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {

        //1.获取spring上下文对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");

        //2.通过上下文对象获取bean
        //User user = (User) context.getBean("user");
        User user = context.getBean("user",User.class);
        //3.使用bean对象
        System.out.println(user.sayHi("韩高辉"));

    }
}
